<?php 
/*
Plugin Name: Seta contact
*/
class Seta_contact_Widget extends WP_Widget{

  public function __construct() {
        parent::__construct(false,$name = __('Seta Contact Us'));
  }
  public function widget( $args,$instanse ){

    if(isset($instanse['show_post_widget_title'])){
        $widget_title = $instanse['show_post_widget_title'];
    }

    if(isset($instanse['show_post_widget_cat_value'])){
        $cat_id = $instanse['show_post_widget_cat_value'];
    }

    if(isset($instanse['num_post'])){
        $num_post = $instanse['num_post'];
    }
?>
<!-- output html -->
<footer>
  <iframe id="companyMap" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3723.8864024416653!2d105.79041254232786!3d21.03723085355461!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3135ab36316c1a4f%3A0x1359a46c8ea0554!2sSetacinq+Vietnam%2CLtd.!5e0!3m2!1sen!2s!4v1401699881129"  frameborder="0" style="border:0"></iframe>
  
  <div class="region">
    <div class="container">
      <div class="row">
        <div class="col-lg-4">
          <div class="title">Liên hệ</div>
          <div class="content">
            <p>
              Địa chỉ: Tòa nhà 3D, Phố Duy Tân, <br>
              Quận Cầu Giấy, Hà Nội
            </p>
            <p>
              Phone: +84 5783-4511 <br>
              Mobil: +84 5783-4511
            </p>
            <p>
              E-mail: info@seta-international.co.jp <br>
              Support: support@seta-international.co.jp
            </p>
            <p class="btn-map"><a href="javascript:void(0)" id="btnShowMap" class="btn btn-primary" role="button">Xem bản đồ</a></p>
          </div>
          
        </div>
        <div class="col-lg-4">
          <div class="title">Liên kết</div>
          <div class="content">
            <ul class="footermenu clearfix">
              <li><a href="#">Trang chủ</a></li>
              <li><a href="#">Giới thiệu</a></li>
              <li><a href="#">Dịch vụ</a></li>
              <li><a href="#">Tin tức</a></li>
              <li><a href="#">Tuyển dụng</a></li>
              <li><a href="#">Sản phẩm</a></li>
              <li><a href="#">Văn phòng</a></li>
              <li><a href="#">Môi trường làm việc</a></li>
              <li><a href="#">Vị trí tuyển dụng</a></li>
              <li><a href="#">Blog</a></li>
            </ul>
            <p class="partners">
              <a href="javascript:void(0)" class="btn btn-primary" role="button">Bit-isle</a>
              <a href="javascript:void(0)" class="btn btn-primary" role="button">Seta JP</a>
              <a href="javascript:void(0)" class="btn btn-primary" role="button">Seta US</a>
            </p>
          </div>
        </div>
        <div class="col-lg-4">
          <div class="content">
            <iframe src="http://www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fsetacinq&amp;width=350&amp;height=290&amp;colorscheme=light&amp;show_faces=true&amp;header=true&amp;stream=false&amp;show_border=true&amp;appId=614602058623936" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px; height:290px;" allowTransparency="true"></iframe>
          </div>
        </div>
      </div>
    </div>
  </div>
  <a href="javascript:void(0)" id="btnHideMap" class="btn btn-primary" role="button">Xem bản đồ</a>
</footer>
<p class="copyright">
  Copyright @2014 - Seta international asia
</p>
<?php 
  }
  public function form( $instanse ){

    $instance = wp_parse_args( (array) $instance, $defaults );

    if(isset($instanse['show_post_widget_cat_value'])){
        $show_post_widget_cat_value = $instanse['show_post_widget_cat_value'];
    }
    
    if(isset($instanse['show_post_widget_title'])){
        $show_post_widget_title = $instanse['show_post_widget_title'];
    }
    
    if(isset($instanse['num_post'])){
        $num_post = $instanse['num_post'];
    }
?>
<!-- Widget form -->
<p>Title:<input type="text" name="<?php echo $this->get_field_name('show_post_widget_title'); ?>" value="<?php echo $show_post_widget_title; ?> " /></p>
<?php    
  }
  public function update($new_instance,$old_instance){
    $instance = $old_instance;
      
    $instance['show_post_widget_cat_value'] = (!empty($new_instance['show_post_widget_cat_value'])) ? 
    strip_tags($new_instance['show_post_widget_cat_value']) : '';
    
    $instance['show_post_widget_title'] = (!empty($new_instance['show_post_widget_title'])) ? 
    strip_tags($new_instance['show_post_widget_title']) : '';
    
    $instance['num_post'] = (!empty($new_instance['num_post'])) ? 
    strip_tags($new_instance['num_post']) : '';
    
    return $instance;
  }
}
add_action('widgets_init',function(){register_widget('Seta_contact_Widget');});